package cn.buk.qms.captcha;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: william
 * Date: 14-7-7
 * Time: 上午12:31
 * To change this template use File | Settings | File Templates.
 */
public interface CaptchaService
{
    String generateCaptchaKey(final String key)
            throws CaptchaException;

    /**
     * 根据验证码内容生成图片
     * @param captchaKey
     * @return
     * @throws CaptchaException
     */
    byte[] generateCaptchaImage( String captchaKey )
            throws CaptchaException;

    /**
     * 验证录入的校验码是否正确
     * @param captchaKey
     * @param captchaValue
     * @return
     * @throws CaptchaException
     */
    boolean validateCaptcha( String captchaKey, String captchaValue )
            throws CaptchaException;

    List<String> getPreDefinedTexts();

    void setPreDefinedTexts( List<String> preDefinedTexts );
}
